New Zealand MWS IG
1.1.5 - Release

New Zealand MWS IG - Local Development build (v1.1.5) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

## Update Allergy Intolerance

### Update AllergyIntolerance for Patient

The Update AllergyIntolerance operation is initiated by a user who needs to update an AllergyIntolerance record for a patient.

#### Update AllergyIntolerance processing steps:

1. A FHIR Client sends a PUT request to the MWS AllergyIntolerance endpoint with a payload containing the MwsAllergyIntolerance resource to be updated.
2. The request is validated - ALT: Validation failure. Operation Outcome resource returned
3. The AllergyIntolerance is updated in the MWS database
4. A updated MwsAllergyIntolerance record is returned to the client

#### Update AllergyIntolerance Request Example

This is an example of an update request: update AllergyIntolerance

#### Update AllergyIntolerance Errors

Business Rule | HTTP error | EM error | Codesystem displayname | Additional description
--- | --- | --- | --- | ---
The ID supplied must be found in MWS | 404 Not found |  |  | Allergy Intolerance with identifier <id> not found
The version supplied must match the version of the current record | 400 Bad request | EM07201 | The request record version number does not match the current resource record version number | The request record version number does not match the current resource record version number
AllergyIntolerance.clinicalStatus SHALL be present if verificationStatus is not entered-in-error. | 400 Bad request |  |  | Rule ait-1: 'AllergyIntolerance.clinicalStatus SHALL be present if verificationStatus is not entered-in-error.
AllergyIntolerance.clinicalStatus SHALL NOT be present if verification Status is entered-in-error. | 400 Bad request |  |  | Rule ait-2: AllergyIntolerance.clinicalStatus SHALL NOT be present if verification Status is entered-in-error
ClinicalStatus must be a valid code. | 422 Unprocessable content |  |  | None of the codings provided are in the value set clinical status
Verification status must be a valid code | 422 Unprocessable content |  |  | None of the codings provided are in the value set verification status
A VerificationStatus of refuted must have a clinicalStatus of inactive | 400 Bad request | EM07202 | Field is required when another field is present | A verification status of refuted must have an inactive clinical status
Category is a required field | 400 Bad request | EM07201 | Missing a required field | Category is a required field
Category must be a valid code | 422 Unprocessable content |  |  | None of the codings provided are in the value set allergy intolerance category
AllergyIntolerance code is a required field | 400 Bad request | EM07201 | Missing a required field | Allergy Intolerance code is a required field
AllergyIntolerance.code must be a valid code | 422 Unprocessable content | EM07201 | Missing a required field | None of the codings provided are in the value set mws substance combined
Patient NHI is a required field | 400 Bad request |  |  | Patient: minimum required = 1, but only 0 found
The Patient NHI must match the existing NHI on the record or it must be one of the other NHIs valid for the patient. | 400 Bad request | EM07306 | Request NHI does not match the resource NHI | The Patient NHI supplied is for a different person than the NHI submitted when this warning was created.
Onset date must not be a future date | 400 Bad request | EM07212 | Cannot be a future date | Onset date cannot be in the future
Onset date must be greater than or equal to the patient's date of birth | 400 Bad request | EM07303 | Date must be greater than date of birth | Onset date must be greater than or equal to the patient's date of birth
Recorder location is a required field | 400 Bad request | EM07201 | Missing a required field | Recorder HPI facilityID is a required field
Recorder location must be a valid HPI facilityID | 400 Bad request | EM02002 | Cannot be found | HPI Facility ID not found in the HPI
Recorder organization must be a valid HPI OrganisationID | 400 Bad request | EM02002 | Cannot be found | HPI Organisation ID not found in the HPI
The recorder practitioner must be either an HPI CPN or a local identifier | 400 Bad request | EM07201 | Missing a required field | Recorder Practitioner is a required field
A recorder practitioner HPI CPN must be in the HPI | 400 Bad request | EM02002 | Cannot be found | HPI CPN not found in the HPI
A recorder practitioner’s local identifier must have a system and an ID. | 400 Bad request | EM07201 | Missing a required field | A recorder's local identifier must have a system and ID
A recorder practitioner’s local identifier must have a system and an ID. | 400 Bad request | EM07201 | Missing a required field | A recorder's local identifier must have a system and ID
Manifestation must be a valid code | 422 Unprocessable content |  |  | None of the codings provided are in the value set mws manifestations
The set of manifestations must not include any duplicate manifestation codes | 400 Bad request | EM7307 | Contains duplicates | The set of reaction manifestations contains duplicate manifestation codes