Beispiel #1
0
def impl_diagnosticreport_5(inst):
    assert inst.basedOn[0].reference == "ServiceRequest/example-pgx"
    assert inst.code.coding[0].code == "PGxReport"
    assert inst.code.coding[0].display == "Pharmacogenetics Report"
    assert inst.code.coding[0].system == "https://system/PGxReport"
    assert inst.code.text == "Pharmacogenetics Report"
    assert inst.effectiveDateTime == fhirtypes.DateTime.validate(
        "2016-10-15T12:34:56+11:00")
    assert inst.id == "example-pgx"
    assert inst.issued == fhirtypes.Instant.validate(
        "2016-10-20T14:00:05+11:00")
    assert inst.meta.tag[0].code == "HTEST"
    assert inst.meta.tag[0].display == "test health data"
    assert (inst.meta.tag[0].system ==
            "http://terminology.hl7.org/CodeSystem/v3-ActReason")
    assert inst.performer[0].reference == "Organization/4829"
    assert inst.presentedForm[0].contentType == "application/pdf"
    assert inst.presentedForm[0].creation == fhirtypes.DateTime.validate(
        "2016-10-20T20:00:00+11:00")
    assert inst.presentedForm[0].data == bytes_validator(
        "cGRmSW5CYXNlNjRCaW5hcnk=")
    assert inst.presentedForm[0].hash == bytes_validator(
        "571ef9c5655840f324e679072ed62b1b95eef8a0")
    assert inst.presentedForm[0].language == "en"
    assert inst.presentedForm[0].title == "Pharmacogenetics Report"
    assert inst.result[0].reference == "Observation/example-phenotype"
    assert inst.status == "final"
    assert inst.subject.display == "Bob Smith"
    assert inst.subject.reference == "Patient/899962"
    assert inst.text.status == "generated"
Beispiel #2
0
def impl_documentmanifest_2(inst):
    assert inst.contained[0].id == "org-1"
    assert inst.content[0].pAttachment.contentType == "application/pdf"
    assert inst.content[0].pAttachment.creation == fhirtypes.DateTime.validate(
        "2010-02-01T11:50:23-05:00"
    )
    assert inst.content[0].pAttachment.data == bytes_validator("SGVsbG8=")
    assert inst.content[0].pAttachment.title == "accident notes 20100201.pdf"
    assert inst.content[1].pAttachment.contentType == "application/pdf"
    assert inst.content[1].pAttachment.creation == fhirtypes.DateTime.validate(
        "2010-02-01T10:57:34+01:00"
    )
    assert inst.content[1].pAttachment.hash == bytes_validator("SGVsbG8gdGhlcmU=")
    assert inst.content[1].pAttachment.size == 104274
    assert inst.content[1].pAttachment.url == "http://happyvalley.com/docs/AB12345"
    assert inst.created == fhirtypes.DateTime.validate("2014-09-21T11:50:23-05:00")
    assert inst.id == "654789"
    assert inst.identifier[0].system == "http://happyvalley.com/supportingdocumentation"
    assert inst.identifier[0].value == "52345"
    assert inst.recipient[0].reference == "#org-1"
    assert inst.related[0].identifier.system == "http://happyvalley.com/claim"
    assert inst.related[0].identifier.value == "12345"
    assert (
        inst.related[1].identifier.system
        == "http://www.BenefitsInc.com/fhir/remittance"
    )
    assert inst.related[1].identifier.value == "R3500"
    assert inst.status == "current"
    assert inst.text.div == (
        '<div xmlns="http://www.w3.org/1999/xhtml">A Financial '
        "Management Attachment example</div>"
    )
    assert inst.text.status == "generated"
Beispiel #3
0
def impl_communication_1(inst):
    assert inst.about[0].identifier.system == "http://happyvalley.com/claim"
    assert inst.about[0].identifier.value == "12345"
    assert (inst.about[1].identifier.system ==
            "http://www.BenefitsInc.com/fhir/claimresponse")
    assert inst.about[1].identifier.value == "R3500"
    assert inst.category[0].coding[0].code == "SolicitedAttachment"
    assert inst.category[0].coding[0].system == "http://acme.org/messagetypes"
    assert inst.id == "fm-attachment"
    assert inst.identifier[
        0].system == "http://www.providerco.com/communication"
    assert inst.identifier[0].value == "12345"
    assert inst.meta.tag[0].code == "HTEST"
    assert inst.meta.tag[0].display == "test health data"
    assert (inst.meta.tag[0].system ==
            "http://terminology.hl7.org/CodeSystem/v3-ActReason")
    assert inst.payload[0].contentAttachment.contentType == "application/pdf"
    assert inst.payload[
        0].contentAttachment.creation == fhirtypes.DateTime.validate(
            "2010-02-01T11:50:23-05:00")
    assert inst.payload[0].contentAttachment.data == bytes_validator(
        "SGVsbG8=")
    assert inst.payload[
        0].contentAttachment.title == "accident notes 20100201.pdf"
    assert inst.payload[1].contentAttachment.contentType == "application/pdf"
    assert inst.payload[
        1].contentAttachment.creation == fhirtypes.DateTime.validate(
            "2010-02-01T10:57:34+01:00")
    assert inst.payload[1].contentAttachment.hash == bytes_validator(
        "SGVsbG8gdGhlcmU=")
    # Don't know how to create unit test
    # for "payload[1].contentAttachment.size",
    # which is a Integer64
    assert inst.payload[
        1].contentAttachment.url == "http://example.org/docs/AB12345"
    assert inst.recipient[
        0].identifier.system == "http://www.jurisdiction.com/insurer"
    assert inst.recipient[0].identifier.value == "123456"
    assert (inst.sender.identifier.system ==
            "http://www.jurisdiction.com/provideroffices")
    assert inst.sender.identifier.value == "3456"
    assert inst.sent == fhirtypes.DateTime.validate(
        "2016-06-12T18:01:10-08:00")
    assert inst.status == "completed"
    assert inst.subject.reference == "Patient/1"
    assert inst.text.div == (
        '<div xmlns="http://www.w3.org/1999/xhtml">Attachment which'
        " is unsolicited</div>")
    assert inst.text.status == "generated"
Beispiel #4
0
def impl_provenance_1(inst):
    assert inst.activity.code == "AU"
    assert inst.activity.display == "authenticated"
    assert inst.activity.system == "http://hl7.org/fhir/v3/DocumentCompletion"
    assert inst.agent[0].role[0].coding[0].code == "VERF"
    assert (
        inst.agent[0].role[0].coding[0].system
        == "http://www.hl7.org/fhir/contractsignertypecodes"
    )
    assert inst.agent[0].whoUri == "mailto://[email protected]"
    assert inst.id == "signature"
    assert inst.reason[0].code == "TREAT"
    assert inst.reason[0].display == "treatment"
    assert inst.reason[0].system == "http://hl7.org/fhir/v3/ActReason"
    assert inst.recorded == fhirtypes.Instant.validate("2015-08-27T08:39:24+10:00")
    assert inst.signature[0].blob == bytes_validator("Li4u")
    assert inst.signature[0].contentType == "application/signature+xml"
    assert inst.signature[0].type[0].code == "1.2.840.10065.1.12.1.5"
    assert inst.signature[0].type[0].display == "Verification Signature"
    assert inst.signature[0].type[0].system == "urn:iso-astm:E1762-95:2013"
    assert inst.signature[0].when == fhirtypes.Instant.validate(
        "2015-08-27T08:39:24+10:00"
    )
    assert inst.signature[0].whoReference.reference == "Practitioner/xcda-author"
    assert inst.target[0].reference == "DocumentReference/example"
    assert inst.text.div == (
        '<div xmlns="http://www.w3.org/1999/xhtml">procedure record'
        " authored on 27-June 2015 by Harold Hippocrates, MD Content "
        "extracted from Referral received 26-June</div>"
    )
    assert inst.text.status == "generated"
Beispiel #5
0
def impl_provenance_2(inst):
    assert inst.agent[0].role[0].coding[0].code == "AUT"
    assert (
        inst.agent[0].role[0].coding[0].system
        == "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
    )
    assert inst.agent[0].who.reference == "Patient/72"
    assert inst.id == "consent-signature"
    assert inst.meta.tag[0].code == "HTEST"
    assert inst.meta.tag[0].display == "test health data"
    assert (
        inst.meta.tag[0].system == "http://terminology.hl7.org/CodeSystem/v3-ActReason"
    )
    assert inst.recorded == fhirtypes.Instant.validate("2016-05-26T00:41:10-04:00")
    assert inst.signature[0].data == bytes_validator("dGhpcyBibG9iIGlzIHNuaXBwZWQ=")
    assert inst.signature[0].sigFormat == "application/signature+xml"
    assert inst.signature[0].targetFormat == "application/fhir+xml"
    assert inst.signature[0].type[0].code == "1.2.840.10065.1.12.1.1"
    assert inst.signature[0].type[0].display == "Author's Signature"
    assert inst.signature[0].type[0].system == "urn:iso-astm:E1762-95:2013"
    assert inst.signature[0].when == fhirtypes.Instant.validate(
        "2016-05-26T00:41:10-04:00"
    )
    assert inst.signature[0].who.reference == "Patient/72"
    assert inst.target[0].reference == "Consent/consent-example-signature"
    assert inst.text.status == "generated"
def impl_auditevent_5(inst):
    assert inst.action == "E"
    assert inst.agent[0].altId == "601847123"
    assert inst.agent[0].name == "Grahame Grieve"
    assert inst.agent[0].requestor is True
    assert inst.agent[0].type.coding[0].code == "humanuser"
    assert inst.agent[0].type.coding[0].display == "human user"
    assert inst.agent[0].type.coding[0].system == (
        "http://terminology.hl7.org/CodeSystem/extra-security-role-"
        "type")
    assert inst.agent[0].who.identifier.value == "95"
    assert inst.agent[1].altId == "6580"
    assert inst.agent[1].network.address == "Workstation1.ehr.familyclinic.com"
    assert inst.agent[1].network.type == "1"
    assert inst.agent[1].requestor is False
    assert inst.agent[1].type.coding[0].code == "110153"
    assert inst.agent[1].type.coding[0].display == "Source Role ID"
    assert (inst.agent[1].type.coding[0].system ==
            "http://dicom.nema.org/resources/ontology/DCM")
    assert inst.agent[
        1].who.identifier.system == "urn:oid:2.16.840.1.113883.4.2"
    assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2"
    assert inst.entity[0].query == bytes_validator(
        ("aHR0cDovL2ZoaXItZGV2LmhlYWx0aGludGVyc2VjdGlvbnMuY29tLmF1L29w"
         "ZW4vRW5jb3VudGVyP3BhcnRpY2lwYW50PTEz"))
    assert inst.entity[0].role.code == "24"
    assert inst.entity[0].role.display == "Query"
    assert (inst.entity[0].role.system ==
            "http://terminology.hl7.org/CodeSystem/object-role")
    assert inst.entity[0].type.code == "2"
    assert inst.entity[0].type.display == "System Object"
    assert (inst.entity[0].type.system ==
            "http://terminology.hl7.org/CodeSystem/audit-entity-type")
    assert inst.id == "example-search"
    assert inst.meta.tag[0].code == "HTEST"
    assert inst.meta.tag[0].display == "test health data"
    assert (inst.meta.tag[0].system ==
            "http://terminology.hl7.org/CodeSystem/v3-ActReason")
    assert inst.outcome.coding[0].code == "0"
    assert inst.outcome.coding[0].display == "Success"
    assert (inst.outcome.coding[0].system ==
            "http://terminology.hl7.org/CodeSystem/audit-event-outcome")
    assert inst.recorded == fhirtypes.Instant.validate("2015-08-22T23:42:24Z")
    assert inst.source.observer.display == "hl7connect.healthintersections.com.au"
    assert inst.source.site == "Cloud"
    assert inst.source.type[0].code == "3"
    assert inst.source.type[0].display == "Web Server"
    assert (inst.source.type[0].system ==
            "http://terminology.hl7.org/CodeSystem/security-source-type")
    assert inst.subtype[0].code == "search"
    assert inst.subtype[0].display == "search"
    assert inst.subtype[0].system == "http://hl7.org/fhir/restful-interaction"
    assert inst.text.status == "generated"
    assert inst.type.code == "rest"
    assert inst.type.display == "Restful Operation"
    assert inst.type.system == "http://terminology.hl7.org/CodeSystem/audit-event-type"
Beispiel #7
0
def impl_communication_1(inst):
    assert inst.category[0].coding[0].code == "SolicitedAttachment"
    assert inst.category[0].coding[0].system == "http://acme.org/messagetypes"
    assert inst.id == "fm-attachment"
    assert inst.identifier[
        0].system == "http://www.providerco.com/communication"
    assert inst.identifier[0].value == "12345"
    assert inst.payload[0].contentAttachment.contentType == "application/pdf"
    assert inst.payload[
        0].contentAttachment.creation == fhirtypes.DateTime.validate(
            "2010-02-01T11:50:23-05:00")
    assert inst.payload[0].contentAttachment.data == bytes_validator(
        "SGVsbG8=")
    assert inst.payload[
        0].contentAttachment.title == "accident notes 20100201.pdf"
    assert inst.payload[1].contentAttachment.contentType == "application/pdf"
    assert inst.payload[
        1].contentAttachment.creation == fhirtypes.DateTime.validate(
            "2010-02-01T10:57:34+01:00")
    assert inst.payload[1].contentAttachment.hash == bytes_validator(
        "SGVsbG8gdGhlcmU=")
    assert inst.payload[1].contentAttachment.size == 104274
    assert (inst.payload[1].contentAttachment.url ==
            "http://happyvalley.com/docs/AB12345")
    assert inst.recipient[
        0].identifier.system == "http://www.jurisdiction.com/insurer"
    assert inst.recipient[0].identifier.value == "123456"
    assert (inst.sender.identifier.system ==
            "http://www.jurisdiction.com/provideroffices")
    assert inst.sender.identifier.value == "3456"
    assert inst.sent == fhirtypes.DateTime.validate(
        "2016-06-12T18:01:10-08:00")
    assert inst.status == "completed"
    assert inst.subject.reference == "Patient/1"
    assert inst.text.div == (
        '<div xmlns="http://www.w3.org/1999/xhtml">Attachment which'
        " is unsolicited</div>")
    assert inst.text.status == "generated"
    assert inst.topic[0].identifier.system == "http://happyvalley.com/claim"
    assert inst.topic[0].identifier.value == "12345"
    assert (inst.topic[1].identifier.system ==
            "http://www.BenefitsInc.com/fhir/claimresponse")
    assert inst.topic[1].identifier.value == "R3500"
Beispiel #8
0
def impl_communication_2(inst):
    assert inst.basedOn[0].reference == "#request"
    assert inst.category[0].coding[0].code == "SolicitedAttachment"
    assert inst.category[0].coding[0].system == "http://acme.org/messagetypes"
    assert inst.contained[0].id == "provider"
    assert inst.contained[1].id == "payor"
    assert inst.contained[2].id == "request"
    assert inst.id == "fm-solicited"
    assert inst.identifier[
        0].system == "http://www.providerco.com/communication"
    assert inst.identifier[0].value == "12345"
    assert inst.meta.tag[0].code == "HTEST"
    assert inst.meta.tag[0].display == "test health data"
    assert (inst.meta.tag[0].system ==
            "http://terminology.hl7.org/CodeSystem/v3-ActReason")
    assert inst.payload[0].contentAttachment.contentType == "application/pdf"
    assert inst.payload[
        0].contentAttachment.creation == fhirtypes.DateTime.validate(
            "2010-02-01T11:50:23-05:00")
    assert inst.payload[0].contentAttachment.data == bytes_validator(
        "SGVsbG8=")
    assert inst.payload[
        0].contentAttachment.title == "accident notes 20100201.pdf"
    assert inst.payload[1].contentAttachment.contentType == "application/pdf"
    assert inst.payload[
        1].contentAttachment.creation == fhirtypes.DateTime.validate(
            "2010-02-01T10:57:34+01:00")
    assert inst.payload[1].contentAttachment.hash == bytes_validator(
        "SGVsbG8gdGhlcmU=")
    assert inst.payload[1].contentAttachment.size == 104274
    assert (inst.payload[1].contentAttachment.url ==
            "http://happyvalley.com/docs/AB12345")
    assert inst.recipient[0].reference == "#payor"
    assert inst.sender.reference == "#provider"
    assert inst.sent == fhirtypes.DateTime.validate(
        "2016-06-12T18:01:10-08:00")
    assert inst.status == "completed"
    assert inst.subject.reference == "Patient/1"
    assert inst.text.div == (
        '<div xmlns="http://www.w3.org/1999/xhtml">Attachment in '
        "response to a Request</div>")
    assert inst.text.status == "generated"
Beispiel #9
0
def impl_media_4(inst):
    assert inst.content.contentType == "audio/mpeg"
    assert inst.content.data == bytes_validator(
        "dG9vIGJpZyB0b28gaW5jbHVkZSB0aGUgd2hvbGU=")
    assert inst.content.id == "a1"
    assert inst.duration == 65
    assert inst.id == "sound"
    assert inst.operator.reference == "Practitioner/xcda-author"
    assert inst.subject.reference == "Patient/xcda"
    assert inst.text.div == (
        '<div xmlns="http://www.w3.org/1999/xhtml">Sound recording '
        "of speech example for Patient Henry Levin (MRN "
        '12345):<br/><img src="#11" alt="diagram"/></div>')
    assert inst.text.status == "generated"
    assert inst.type == "video"
Beispiel #10
0
def impl_auditevent_6(inst):
    assert inst.action == "E"
    assert inst.agent[0].altId == "6580"
    assert inst.agent[0].network.address == "Workstation1.ehr.familyclinic.com"
    assert inst.agent[0].network.type == "1"
    assert inst.agent[0].requestor is False
    assert inst.agent[0].role[0].coding[0].code == "110153"
    assert inst.agent[0].role[0].coding[0].display == "Source Role ID"
    assert (inst.agent[0].role[0].coding[0].system ==
            "http://dicom.nema.org/resources/ontology/DCM")
    assert inst.agent[
        0].userId.value == "2.16.840.1.113883.4.2|2.16.840.1.113883.4.2"
    assert inst.agent[1].altId == "601847123"
    assert inst.agent[1].name == "Grahame Grieve"
    assert inst.agent[1].requestor is True
    assert inst.agent[1].userId.value == "95"
    assert (inst.entity[0].identifier.value ==
            "e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO")
    assert inst.entity[0].role.code == "1"
    assert inst.entity[0].role.display == "Patient"
    assert inst.entity[0].role.system == "http://hl7.org/fhir/object-role"
    assert inst.entity[0].type.code == "1"
    assert inst.entity[0].type.display == "Person"
    assert inst.entity[0].type.system == "http://hl7.org/fhir/object-type"
    assert inst.entity[1].detail[0].type == "MSH-10"
    assert inst.entity[1].detail[0].value == bytes_validator(
        "MS4yLjg0MC4xMTQzNTAuMS4xMy4wLjEuNy4xLjE=")
    assert inst.entity[1].role.code == "24"
    assert inst.entity[1].role.display == "Query"
    assert inst.entity[1].role.system == "http://hl7.org/fhir/object-role"
    assert inst.entity[1].type.code == "2"
    assert inst.entity[1].type.display == "System Object"
    assert inst.entity[1].type.system == "http://hl7.org/fhir/object-type"
    assert inst.id == "example-pixQuery"
    assert inst.outcome == "0"
    assert inst.recorded == fhirtypes.Instant.validate("2015-08-26T23:42:24Z")
    assert inst.source.identifier.value == "hl7connect.healthintersections.com.au"
    assert inst.subtype[0].code == "ITI-9"
    assert inst.subtype[0].display == "PIX Query"
    assert inst.subtype[0].system == "urn:oid:1.3.6.1.4.1.19376.1.2"
    assert inst.text.status == "generated"
    assert inst.type.code == "110112"
    assert inst.type.display == "Query"
    assert inst.type.system == "http://dicom.nema.org/resources/ontology/DCM"
Beispiel #11
0
def impl_provenance_1(inst):
    assert inst.activity.coding[0].code == "AU"
    assert inst.activity.coding[0].display == "authenticated"
    assert (
        inst.activity.coding[0].system
        == "http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion"
    )
    assert inst.agent[0].type.coding[0].code == "VERF"
    assert inst.agent[0].type.coding[0].system == (
        "http://terminology.hl7.org/CodeSystem/contractsignertypecode" "s"
    )
    assert inst.agent[0].who.identifier.system == "urn:ietf:rfc:3986"
    assert inst.agent[0].who.identifier.value == "mailto:[email protected]"
    assert inst.id == "signature"
    assert inst.meta.tag[0].code == "HTEST"
    assert inst.meta.tag[0].display == "test health data"
    assert (
        inst.meta.tag[0].system == "http://terminology.hl7.org/CodeSystem/v3-ActReason"
    )
    assert inst.reason[0].coding[0].code == "TREAT"
    assert inst.reason[0].coding[0].display == "treatment"
    assert (
        inst.reason[0].coding[0].system
        == "http://terminology.hl7.org/CodeSystem/v3-ActReason"
    )
    assert inst.recorded == fhirtypes.Instant.validate("2015-08-27T08:39:24+10:00")
    assert inst.signature[0].data == bytes_validator("Li4u")
    assert inst.signature[0].sigFormat == "application/signature+xml"
    assert inst.signature[0].targetFormat == "application/fhir+xml"
    assert inst.signature[0].type[0].code == "1.2.840.10065.1.12.1.5"
    assert inst.signature[0].type[0].display == "Verification Signature"
    assert inst.signature[0].type[0].system == "urn:iso-astm:E1762-95:2013"
    assert inst.signature[0].when == fhirtypes.Instant.validate(
        "2015-08-27T08:39:24+10:00"
    )
    assert inst.signature[0].who.reference == "Practitioner/xcda-author"
    assert inst.target[0].reference == "DocumentReference/example"
    assert inst.text.div == (
        '<div xmlns="http://www.w3.org/1999/xhtml">procedure record'
        " authored on 27-June 2015 by Harold Hippocrates, MD Content "
        "extracted from Referral received 26-June</div>"
    )
    assert inst.text.status == "generated"
Beispiel #12
0
def impl_device_9(inst):
    assert inst.expirationDate == fhirtypes.DateTime.validate("2014-11-20")
    assert inst.id == "example-udi1"
    assert (
        inst.identifier[0].system == "http://acme.com/devices/pacemakers/octane/serial"
    )
    assert inst.identifier[0].value == "1234-5678-90AB-CDEF"
    assert inst.identifier[1].type.coding[0].code == "SNO"
    assert (
        inst.identifier[1].type.coding[0].system
        == "http://hl7.org/fhir/identifier-type"
    )
    assert inst.identifier[1].value == "10987654d321"
    assert inst.lotNumber == "7654321D"
    assert inst.manufacturer == "Acme Devices, Inc"
    assert inst.model == "PM/Octane 2014"
    assert inst.patient.reference == "Patient/example"
    assert inst.safety[0].coding[0].code == "mr-unsafe"
    assert inst.safety[0].coding[0].display == "MR Unsafe"
    assert inst.safety[0].coding[0].system == "urn:oid:2.16.840.1.113883.3.26.1.1"
    assert inst.safety[0].text == "MR Unsafe"
    assert inst.status == "active"
    assert inst.text.status == "generated"
    assert inst.type.coding[0].code == "468063009"
    assert inst.type.coding[0].display == "Coated femoral stem prosthesis, modular"
    assert inst.type.coding[0].system == "http://snomed.info/sct"
    assert inst.type.text == "Coated femoral stem prosthesis, modular"
    assert inst.udi.carrierAIDC == bytes_validator(
        (
            "XWQyMDExMDg1NzY3NDAwMjAxNzE3MTQxMTIwMTBOWUZVTDAx4oaUMjExOTI4"
            "MzfihpQ3MTNBMUIyQzNENEU1RjZH"
        )
    )
    assert (
        inst.udi.carrierHRF
        == "{01}00844588003288{17}141120{10}7654321D{21}10987654d321"
    )
    assert inst.udi.deviceIdentifier == "00844588003288"
    assert inst.udi.entryType == "barcode"
    assert inst.udi.issuer == "http://hl7.org/fhir/NamingSystem/gs1"
    assert inst.udi.jurisdiction == "http://hl7.org/fhir/NamingSystem/fda-udi"
    assert inst.udi.name == "FHIR® Hip System"
Beispiel #13
0
def impl_provenance_2(inst):
    assert inst.agent[0].role[0].coding[0].code == "AUT"
    assert (
        inst.agent[0].role[0].coding[0].system
        == "http://hl7.org/fhir/v3/ParticipationType"
    )
    assert inst.agent[0].whoReference.reference == "Patient/72"
    assert inst.id == "consent-signature"
    assert inst.recorded == fhirtypes.Instant.validate("2016-05-26T00:41:10-04:00")
    assert inst.signature[0].blob == bytes_validator("dGhpcyBibG9iIGlzIHNuaXBwZWQ=")
    assert inst.signature[0].contentType == "application/signature+xml"
    assert inst.signature[0].type[0].code == "1.2.840.10065.1.12.1.1"
    assert inst.signature[0].type[0].display == "Author's Signature"
    assert inst.signature[0].type[0].system == "urn:iso-astm:E1762-95:2013"
    assert inst.signature[0].when == fhirtypes.Instant.validate(
        "2016-05-26T00:41:10-04:00"
    )
    assert inst.signature[0].whoReference.reference == "Patient/72"
    assert inst.target[0].reference == "Consent/consent-example-signature"
    assert inst.text.status == "generated"
def impl_documentreference_3(inst):
    assert inst.author[0].reference == "Practitioner/xcda-author"
    assert inst.content[0].attachment.contentType == "audio/mpeg"
    assert inst.content[0].attachment.data == bytes_validator(
        "dG9vIGJpZyB0b28gaW5jbHVkZSB0aGUgd2hvbGU="
    )
    assert float(inst.content[0].attachment.duration) == float(65)
    assert inst.id == "sound"
    assert inst.meta.tag[0].code == "HTEST"
    assert inst.meta.tag[0].display == "test health data"
    assert (
        inst.meta.tag[0].system == "http://terminology.hl7.org/CodeSystem/v3-ActReason"
    )
    assert inst.status == "current"
    assert inst.subject.reference == "Patient/xcda"
    assert inst.text.div == (
        '<div xmlns="http://www.w3.org/1999/xhtml">Sound recording '
        "of speech example for Patient Henry Levin (MRN "
        '12345):<br/><img src="#11" alt="diagram"/></div>'
    )
    assert inst.text.status == "generated"
Beispiel #15
0
def impl_documentreference_1(inst):
    assert inst.authenticator.reference == "Organization/f001"
    assert inst.author[0].reference == "Practitioner/xcda1"
    assert inst.author[1].reference == "#a2"
    assert inst.class_fhir.coding[0].code == "History and Physical"
    assert inst.class_fhir.coding[0].display == "History and Physical"
    assert (inst.class_fhir.coding[0].system ==
            "http://ihe.net/xds/connectathon/classCodes")
    assert inst.contained[0].id == "a2"
    assert inst.content[0].attachment.contentType == "application/hl7-v3+xml"
    assert inst.content[0].attachment.hash == bytes_validator(
        "2jmj7l5rSw0yVb/vlWAYkK/YBwk=")
    assert inst.content[0].attachment.language == "en-US"
    assert inst.content[0].attachment.size == 3654
    assert inst.content[0].attachment.url == (
        "http://example.org/xds/mhd/Binary/07a6483f-732b-461e-86b6-ed"
        "b665c45510")
    assert inst.content[0].format.code == "urn:ihe:pcc:handp:2008"
    assert inst.content[
        0].format.display == "History and Physical Specification"
    assert inst.content[0].format.system == "urn:oid:1.3.6.1.4.1.19376.1.2.3"
    assert inst.context.encounter.reference == "Encounter/xcda"
    assert inst.context.event[0].coding[0].code == "T-D8200"
    assert inst.context.event[0].coding[0].display == "Arm"
    assert (inst.context.event[0].coding[0].system ==
            "http://ihe.net/xds/connectathon/eventCodes")
    assert inst.context.facilityType.coding[0].code == "Outpatient"
    assert inst.context.facilityType.coding[0].display == "Outpatient"
    assert inst.context.facilityType.coding[0].system == (
        "http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCo"
        "des")
    assert inst.context.period.end == fhirtypes.DateTime.validate(
        "2004-12-23T08:01:00+11:00")
    assert inst.context.period.start == fhirtypes.DateTime.validate(
        "2004-12-23T08:00:00+11:00")
    assert inst.context.practiceSetting.coding[0].code == "General Medicine"
    assert inst.context.practiceSetting.coding[0].display == "General Medicine"
    assert (inst.context.practiceSetting.coding[0].system ==
            "http://www.ihe.net/xds/connectathon/practiceSettingCodes")
    assert inst.context.related[0].identifier.system == "urn:ietf:rfc:3986"
    assert (inst.context.related[0].identifier.value ==
            "urn:oid:1.3.6.1.4.1.21367.2005.3.7.2345")
    assert inst.context.related[0].ref.reference == "Patient/xcda"
    assert inst.context.sourcePatientInfo.reference == "Patient/xcda"
    assert inst.created == fhirtypes.DateTime.validate(
        "2005-12-24T09:35:00+11:00")
    assert inst.custodian.reference == "Organization/f001"
    assert inst.description == "Physical"
    assert inst.docStatus == "preliminary"
    assert inst.id == "example"
    assert inst.identifier[0].system == "urn:ietf:rfc:3986"
    assert inst.identifier[
        0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234"
    assert inst.indexed == fhirtypes.Instant.validate(
        "2005-12-24T09:43:41+11:00")
    assert inst.masterIdentifier.system == "urn:ietf:rfc:3986"
    assert inst.masterIdentifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7"
    assert inst.relatesTo[0].code == "appends"
    assert inst.relatesTo[0].target.reference == "DocumentReference/example"
    assert inst.securityLabel[0].coding[0].code == "V"
    assert inst.securityLabel[0].coding[0].display == "very restricted"
    assert (inst.securityLabel[0].coding[0].system ==
            "http://hl7.org/fhir/v3/Confidentiality")
    assert inst.status == "current"
    assert inst.subject.reference == "Patient/xcda"
    assert inst.text.status == "generated"
    assert inst.type.coding[0].code == "34108-1"
    assert inst.type.coding[0].display == "Outpatient Note"
    assert inst.type.coding[0].system == "http://loinc.org"
def impl_auditevent_8(inst):
    assert inst.action == "E"
    assert inst.agent[0].altId == "6580"
    assert inst.agent[0].network.address == "Workstation1.ehr.familyclinic.com"
    assert inst.agent[0].network.type == "1"
    assert inst.agent[0].requestor is False
    assert inst.agent[0].type.coding[0].code == "110153"
    assert inst.agent[0].type.coding[0].display == "Source Role ID"
    assert (inst.agent[0].type.coding[0].system ==
            "http://dicom.nema.org/resources/ontology/DCM")
    assert inst.agent[
        0].who.identifier.system == "urn:oid:2.16.840.1.113883.4.2"
    assert inst.agent[0].who.identifier.value == "2.16.840.1.113883.4.2"
    assert inst.agent[1].altId == "601847123"
    assert inst.agent[1].name == "Grahame Grieve"
    assert inst.agent[1].requestor is True
    assert inst.agent[1].type.coding[0].code == "humanuser"
    assert inst.agent[1].type.coding[0].display == "human user"
    assert inst.agent[1].type.coding[0].system == (
        "http://terminology.hl7.org/CodeSystem/extra-security-role-"
        "type")
    assert inst.agent[1].who.identifier.value == "95"
    assert inst.entity[0].role.code == "1"
    assert inst.entity[0].role.display == "Patient"
    assert (inst.entity[0].role.system ==
            "http://terminology.hl7.org/CodeSystem/object-role")
    assert inst.entity[0].type.code == "1"
    assert inst.entity[0].type.display == "Person"
    assert (inst.entity[0].type.system ==
            "http://terminology.hl7.org/CodeSystem/audit-entity-type")
    assert (inst.entity[0].what.identifier.value ==
            "e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO")
    assert inst.entity[1].detail[0].type == "MSH-10"
    assert inst.entity[1].detail[0].valueBase64Binary == bytes_validator(
        "MS4yLjg0MC4xMTQzNTAuMS4xMy4wLjEuNy4xLjE=")
    assert inst.entity[1].role.code == "24"
    assert inst.entity[1].role.display == "Query"
    assert (inst.entity[1].role.system ==
            "http://terminology.hl7.org/CodeSystem/object-role")
    assert inst.entity[1].type.code == "2"
    assert inst.entity[1].type.display == "System Object"
    assert (inst.entity[1].type.system ==
            "http://terminology.hl7.org/CodeSystem/audit-entity-type")
    assert inst.id == "example-pixQuery"
    assert inst.meta.tag[0].code == "HTEST"
    assert inst.meta.tag[0].display == "test health data"
    assert (inst.meta.tag[0].system ==
            "http://terminology.hl7.org/CodeSystem/v3-ActReason")
    assert inst.outcome.coding[0].code == "0"
    assert inst.outcome.coding[0].display == "Success"
    assert (inst.outcome.coding[0].system ==
            "http://terminology.hl7.org/CodeSystem/audit-event-outcome")
    assert inst.recorded == fhirtypes.Instant.validate("2015-08-26T23:42:24Z")
    assert inst.source.observer.display == "hl7connect.healthintersections.com.au"
    assert inst.subtype[0].code == "ITI-9"
    assert inst.subtype[0].display == "PIX Query"
    assert inst.subtype[0].system == "urn:oid:1.3.6.1.4.1.19376.1.2"
    assert inst.text.status == "generated"
    assert inst.type.code == "110112"
    assert inst.type.display == "Query"
    assert inst.type.system == "http://dicom.nema.org/resources/ontology/DCM"
Beispiel #17
0
 def validate(cls, v: Any) -> bson.binary.Binary:
     if isinstance(v, bson.binary.Binary):
         return v
     a = bytes_validator(v)
     return bson.binary.Binary(a)