Closed draakhan closed 8 years ago
Hi!
1) No matches: The server performs a create interaction
SELECT fhir_truncate_storage('{"resourceType": "Patient"}'); SELECT fhir_transaction('{"resourceType":"Bundle","type":"transaction","entry":[{"resource":{"resourceType":"Patient","name":[{"given":["Ala"],"family":["Gray"]}]},"request":{"method":"PUT","url":"Patient?given=Ala"}}]}'); -[ RECORD 1 ]----+---------------------------------------------------------------------------------------------------------------------------------------- fhir_transaction | {"resourceType":"OperationOutcome","issue":[{"severity":"error","code":"422","diagnostics":"Invalid operation PUT Patient?given=Ala"}]}
2) One Match: The server performs the update against the matching resource
SELECT fhir_truncate_storage('{"resourceType": "Patient"}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"resourceType": "Patient","name": [{"given": ["Ala"], "family": ["Blue"]}], "id": "9999"}}'); SELECT fhir_transaction('{"resourceType":"Bundle","type":"transaction","entry":[{"resource":{"resourceType":"Patient","name":[{"given":["Ala"],"family":["Gray"]}]},"request":{"method":"PUT","url":"Patient?given=Ala"}}]}'); -[ RECORD 1 ]----+---------------------------------------------------------------------------------------------------------------------------------------- fhir_transaction | {"resourceType":"OperationOutcome","issue":[{"severity":"error","code":"422","diagnostics":"Invalid operation PUT Patient?given=Ala"}]}
3) Multiple matches: The server returns a 412 Precondition Failed error indicating the client's criteria were not selective enough
SELECT fhir_truncate_storage('{"resourceType": "Patient"}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"resourceType": "Patient","name": [{"given": ["Ala"], "family": ["Blue"]}], "id": "9999"}}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"resourceType": "Patient","name": [{"given": ["Ala"], "family": ["Black"]}], "id": "9998"}}'); SELECT fhir_transaction('{"resourceType":"Bundle","type":"transaction","entry":[{"resource":{"resourceType":"Patient","name":[{"given":["Ala"],"family":["Gray"]}]},"request":{"method":"PUT","url":"Patient?given=Ala"}}]}'); -[ RECORD 1 ]----+---------------------------------------------------------------------------------------------------------------------------------------- fhir_transaction | {"resourceType":"OperationOutcome","issue":[{"severity":"error","code":"422","diagnostics":"Invalid operation PUT Patient?given=Ala"}]}
@draakhan fixed in v1.3.0.24 https://github.com/fhirbase/fhirbase-plv8/blob/v1.3.0.24/test/fhir/transaction_spec.coffee#L104 if not, feel free to reopen
Hi!
1) No matches: The server performs a create interaction
2) One Match: The server performs the update against the matching resource
3) Multiple matches: The server returns a 412 Precondition Failed error indicating the client's criteria were not selective enough