MVP - Bulk Data Update

The following model modifications require a bulk data update.

Action New Element Script Test Status
Add Service Request - Created User Script Location Not Tested
Add Service Request - Created Date Script Location Not Tested
Add Service Request - Submitted User Script Location Not Tested
Add Service Request - Category Script Location Not Tested
Add Location - Status Script Location Not Tested

Service Request - Created User

"extension": [{
        "url": "https://health.gov.on.ca/sadie/fhir/StructureDefinition/CreatedUser",
        "valueReference": {
                "reference": "PractitionerRole/cdb3fa96-507b-48ac-8983-cac710085c0c/_history/2"
            }
}]
Elements Population Logic
url "https://health.gov.on.ca/sadie/fhir/StructureDefinition/CreatedUser"
reference If it is NULL then copy ServiceRequest.performer

Service Request - Created Date

"extension": [{
        "url": "https://health.gov.on.ca/sadie/fhir/StructureDefinition/RequestCreatedDate",
        "valueDateTime": "2021-11-10T19:39:24Z"
}]
Elements Population Logic
url "https://health.gov.on.ca/sadie/fhir/StructureDefinition/RequestCreatedDate"
valueDateTime If it is NUL then copy ServiceRequest.meta.lastUpdated from the first version of that ServiceRequest

Service Request - Submitted User

"extension": [{
        "url": "https://health.gov.on.ca/sadie/fhir/StructureDefinition/SubmittedUser",
        "valueReference": {
                "reference": "PractitionerRole/cdb3fa96-507b-48ac-8983-cac710085c0c/_history/2"
            }
}]
Elements Population Logic
url "https://health.gov.on.ca/sadie/fhir/StructureDefinition/SubmittedUser"
reference If it is NULL and RequestSubmittedDate is populated then copy ServiceRequest.performer


Service Request - Category


"category": [
                {
                    "coding": [
                        {
                            "system": "https://health.gov.on.ca/sadie/fhir/CodeSystem/FlexForms-Internal-Complete",
                            "code": "NEW-REQUEST"
                        }
                    ]
                }
            ]

Elements Population Logic
system "https://health.gov.on.ca/sadie/fhir/CodeSystem/FlexForms-Internal-Complete"
code If it is NULL then populate with "NEW-REQUEST"

Service Request - Questionnaire Code

 "reasonCode":  [
        {
            "coding":  [
                {
                    "system": "https://health.gov.on.ca/sadie/fhir/CodeSystem/FlexForms-Internal-Complete",
                    "code": "HSR"
                }
            ]
        }
    ]
Elements Population Logic
system "https://health.gov.on.ca/sadie/fhir/CodeSystem/FlexForms-Internal-Complete"
code If NULL look up the Questionniare Code by finding the related QuestionnaireResponse and from there link to the Questionnaire. It's the Questionnaire.identifier.value